<template>
  <div class="project-detal">
    <top-header></top-header>
    <div class="common-list-body" v-fullheight>
      <detail-top :content="detail.name"></detail-top>

      <ul>
        <li>
          <span>项目代码：</span>
          <span>{{ $tools.showContent(detail.code) }}</span>
        </li>
        <li>
          <span>委托单位：</span>
          <span>{{ $tools.showContent(detail.party) }}</span>
        </li>
        <li>
          <span>项目负责人：</span>
          <span>{{ $tools.showContent(detail.projectLeader) }}</span>
        </li>
        <li>
          <span>执行部门：</span>
          <span>{{ $tools.showContent(detail.executeDept) }}</span>
        </li>
        <li>
          <span>包含业务类型：</span>
          <span>{{ $tools.showContent(detail.businessCategory) }}</span>
        </li>
        <li>
          <span>项目进展：</span>
          <span>{{ $tools.showContent(projectStatus[detail.status]) }}</span>
        </li>
        <li>
          <span>开始服务日期：</span>
          <span>{{ $tools.showContent(detail.startDate) }}</span>
        </li>
        <li>
          <span>完成服务日期：</span>
          <span>{{ $tools.showContent(detail.endDate) }}</span>
        </li>
        <li>
          <span>所在地区：</span>
          <span>{{ $tools.showContent(detail.areaName) }}</span>
        </li>
        <li>
          <span>项目地址：</span>
          <span>{{ $tools.showContent(detail.address) }}</span>
        </li>
        <li>
          <span>项目总投资(万元)：</span>
          <span>{{ $tools.showContent(detail.investment) }}</span>
        </li>
        <li>
          <span>建设类型：</span>
          <span>{{ $tools.showContent(detail.constructionType) }}</span>
        </li>
        <li>
          <span>所属行业：</span>
          <span>{{ $tools.showContent(detail.industrys) }}</span>
        </li>
      </ul>
    </div>
  </div>
</template>

<script lang="ts">
import { Component } from "vue-property-decorator";
import TopHeader from "@/components/TopHeader.vue";
import Api from "@/api";
import Enum from "@/typings/Enum";
import Base from "@/utils/base";
import DetailTop from "@/components/DetailTop.vue";

@Component({
  name: "ProjectDetail",
  components: {
    DetailTop,
    TopHeader
  }
})
export default class ProjectDetail extends Base {
  private projectStatus = Enum.ProjectStatus;
  private projectId = "";
  private detail: any = {};

  private created() {
    this.projectId = (this.$route.query.projectId ? this.$route.query.projectId : "").toString();
    if (this.projectId) {
      this.$cPromise.all([this.getProjectDetail()]);
    }
  }

  private async getProjectDetail() {
    const res = await Api.GetProjectDetail(this.projectId);
    if (res && res.code) {
      this.detail = res.data;
    }
    return res;
  }
}
</script>

<style lang="less" scoped>
.project-detal {
  .common-list-body {
    // background: url("~@/assets/images/project-detail.png") top center no-repeat;
    background-size: 100%;
  }
  ul {
    background-color: white;
    border-radius: 5px;
    box-shadow: 0px 5px 11px 0px rgba(3, 0, 195, 0.05);
    margin: 10px 10px 0 10px;
    padding: 16px 23px 16px 30px;
    color: #596275;
    font-size: 13px;
  }
  li {
    position: relative;
    padding: 8px 0px;
    display: flex;
    justify-content: space-between;
    span {
      &:first-child {
        flex-shrink: 0;
      }

      &:last-child {
        width: 66%;
        text-align: right;
      }
    }
    &::before {
      height: 5px;
      width: 5px;
      border-radius: 5px;
      left: -13px;
      top: 15px;
      position: absolute;
      content: "";
      background-color: #d8d8d8;
    }
  }

  ul {
    margin-bottom: 12px;
  }
}
</style>
